// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

import 'package:hawk/hawk.dart';

import '../main_test.dart';

class HandleCleanCase extends HandleBaseCase {
  HandleCleanCase();

  @override
  Future<ResultBean?> handle(event) async {
    super.handle(event);

    if (className?.trim() != 'CleanService') {
      return null;
    }

    switch (methodName?.trim()) {
      case "cleanStream":
        subsriptions.forEach((e) {
          e.cancel();
        });
        subsriptions.clear();
        break;
    }

    return ResultBean(
      code: 0,
      data: null,
      message: 'clean finish',
    );
  }
}
